﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace ConfigServices
{
   class IniFileConfigService : IConfigService
  {
    public string FilePath { get; set; }

    public string GetValue(string name)
    {
      return File.ReadAllLines(FilePath).Select(s => s.Split('='))
         .Select(a => new { Name = a[0], Value = a[1] })
         .SingleOrDefault(kv => kv.Name == name)?.Value??string.Empty;
    }
  }
}
